package com.yc.edu.controller;

import com.yc.edu.pojo.DigitalPeople;
import com.yc.edu.pojo.Result;
import com.yc.edu.service.DigitalPeopleService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/DigitalPeople")
public class DigitalPeopleController {
    @Resource
    private DigitalPeopleService digitalPeopleService;

    @GetMapping("/getDigitalPeopleList")
    public Result getDigitalPeopleList() {
        List<DigitalPeople> list = digitalPeopleService.getDigitalPeopleList();
        return Result.success(list);
    }

    @GetMapping("/getChatHistory")
    public Result getChatHistory(@RequestParam String name, String dialogUser) {
        return Result.success(digitalPeopleService.getChatHistory(name, dialogUser));
    }
    @PostMapping("/insertDigitalPeople")
    public Result insertDigitalPeople(@RequestBody DigitalPeople digitalPeople) {
        System.out.println(digitalPeople);
        return Result.success();
    }
}
